<head>
	<meta charset="utf8">
</head>
<?php 
// 开启数据库连接
include("../functions/db_conn.php");
$SociNo = trim($_POST["SociNo"]);  // 社团编号
// 判断是否接收到图片的数据
if (file_exists($_FILES["face"]["tmp_name"]))
{
	// 删除原来的照片
	$oldpic = "../uploadpics/$SociNo.jpg";
	unlink($oldpic);
	// 上传新的图片
	$target_path = "../uploadpics/$SociNo.jpg";
	move_uploaded_file($_FILES["face"]["tmp_name"], $target_path);
	echo "<script>";
	echo "alert(\"上传图片文件成功！\"); ";
	echo "location.href = \"updatesoci_do.php\" ";
	echo "</script>";
}
else
{
	echo "<script>";
	echo "alert(\"上传图片文件失败！\"); ";
	echo "location.href = \"updateCourse.php\" ";
	echo "</script>";	
}
?>